<template>
  <div>
    <!-- 1. 将表单设置为一个子组件，表单内要有用户名和密码输入框
       2. 提交按钮写在父组件
       3. 点击提交按钮提交表单，将表单的内容打印到控制台，并且还原表单 -->
    <FromDate ref="SonFormdata" />
    <button @click="submit">提交</button>
  </div>
</template>

<script>
import FromDate from './components/RefHmForm.vue'
export default {
  name: 'HmForm',
  //注册子组件
  components: {
    FromDate,
  },
  methods: {
    submit() {
      this.$refs.SonFormdata.isdata()
      // this.$refs.SonFormdata.formdata.password = ''
      // this.$refs.SonFormdata.formdata.username = ''
    },
  },
}
</script>

<style scoped></style>
